<%-- 
    Document   : Admin
    Created on : Dec 18, 2014, 3:09:49 PM
    Author     : Tran Thuy Duong
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
	<title>Handmade</title>
	<link rel="stylesheet" href="css_admin/style.css" type="text/css" media="all" />
       <script>
            // Load Login
        function loadSearch()
        {
          
        var xmlhttp;
        if (window.XMLHttpRequest)
          {// code for IE7+, Firefox, Chrome, Opera, Safari
          xmlhttp=new XMLHttpRequest();
          }
        else
          {// code for IE6, IE5
          xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
          }
        xmlhttp.onreadystatechange=function()
          {
          if (xmlhttp.readyState==4 && xmlhttp.status==200)
            {
            document.getElementById("table").innerHTML=xmlhttp.responseText;
            }
          }
        var x = document.getElementById("field small-field").value;
        xmlhttp.open("GET","C_Customer?btAction=Search&txtSearch=" + x,true);
        xmlhttp.send();
        }
        
        
        </script>
</head>
<body>
<!-- Header -->
<div id="header">
	<div class="shell">
		<!-- Logo + Top Nav -->
		<div id="top">
			<h1><a href="#">Handmade</a></h1>
			<div id="top-navigation">
				Xin chào <a href="#"><strong>Quản trị viên</strong></a>
				<span>|</span>
				<a href="#">Help</a>
				<span>|</span>
				<a href="#">Profile Settings</a>
				<span>|</span>
				<a href="#">Log out</a>
			</div>
		</div>
		<!-- End Logo + Top Nav -->
		
		<!-- Main Nav -->
		<div id="navigation">
			<ul>
			    <li><a href="Customers.jsp" class="active"><span>Khách hàng</span></a></li>
			    <li><a href="News.jsp"><span>Tin tức</span></a></li>
			    <li><a href="#"><span>Đơn hàng</span></a></li>
			    <li><a href="C_Show_Contact"><span>Thông tin liên hệ</span></a></li>
			    <li><a href="#"><span>Products</span></a></li>
			    <li><a href="#"><span>Services Control</span></a></li>
			</ul>
		</div>
		<!-- End Main Nav -->
	</div>
</div>
<!-- End Header -->

<!-- Container -->
<div id="container">
	<div class="shell">
		
		<!-- Small Nav -->
		<div class="small-nav">
			<a href="#">Khách hàng</a>
			<span>&gt;</span>
			
		</div>
		<!-- End Small Nav -->
		
		<!-- Message OK -->		
		<div class="msg msg-ok">
			<p><strong>Your file was uploaded succesifully!</strong></p>
			<a href="#" class="close">close</a>
		</div>
		<!-- End Message OK -->		
		
		<!-- Message Error -->
		<div class="msg msg-error">
			<p><strong>You must select a file to upload first!</strong></p>
			<a href="#" class="close">close</a>
		</div>
		<!-- End Message Error -->
		<br />
		<!-- Main -->
		<div id="main">
			<div class="cl">&nbsp;</div>
			
			<!-- Content -->
			<div id="content">
				
				<!-- Box -->
				<div class="box">
					<!-- Box Head -->
					<div class="box-head">
						<h2 class="left">Khách hàng</h2>
                                               
						<div class="right">
							<label>Tìm khách hàng</label>
                                                        <input type="text" class="field small-field" id="field small-field" name="txtSearch" onkeyup="loadSearch();"/>                                                    
						</div>
                                              
					</div>
					<!-- End Box Head -->	

					<!-- Table -->
					<div class="table" id="table">
                                                <c:set var="INFO" value="${requestScope.INFO}"/>
                                                <c:if test="${not empty INFO}">
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<th width="13"><input type="checkbox" class="checkbox" /></th>
                                                                <th>STT</th>
                                                                <th>Mã</th>
								<th>Tên khách hàng</th>
								<th>Giới tính</th>
								<th>SDT</th>
								<th>Địa chỉ</th>
								<th>CMND</th>
								<th width="110" class="ac">Content Control</th>
							</tr>
                                                    <c:set var="count" value="0"/>
                                                    <c:forEach var="rows" items="${INFO}">
                                                    <c:set var="count" value="${count + 1}"/>
							<tr>
                                                            <form method="get" action="C_Customer">
								<td><input type="checkbox" class="checkbox" /></td>
                                                                <td>${count}</td>
                                                                 <td>${rows.makh}</td>
                                                                 <input type="hidden" name="U_txtmakh" value="${rows.makh}"/>
								<td><h3><input type="text" name="U_txttenkh" value="${rows.tenkh}" size="10"/></h3></td>
								<td><input type="text" name="U_txtgioitinh" value="${rows.gioitinh}" size="3"/></td>
								<td><input type="text" name="U_txtsdt" value="${rows.sdt}" size="10"/></td>
								<td><input type="text" name="U_txtdiachi" value="${rows.diachi}" size="10"/></td>
								<td><input type="text" name="U_txtcmnd" value="${rows.cmnd}" size="10"/></td>
                                                                <c:url var="delete" value="C_Customer">
                                                                    <c:param name="btAction" value="Delete"/>
                                                                    <c:param name="makh" value="${rows.makh}"/>
                                                                    <c:param name="txtSearch" value="${param.txtSearch}"/>
                                                                </c:url>
                                                              
                                                                <td><a href="${delete}" class="ico del">Delete</a><input class="ico edit" type="submit" value="Update" name="btAction"/></td>
                                                            </form>
							</tr>
                                                    </c:forEach>
						</table>
                                                </c:if>  
						
						
						<!-- Pagging -->
						<div class="pagging">
							<div class="left">Showing 1-8 of 44</div>
							<div class="right">
								<a href="#">Previous</a>
								<a href="#">1</a>
								<a href="#">2</a>
								<a href="#">3</a>
								<a href="#">4</a>
								<a href="#">245</a>
								<span>...</span>
								<a href="#">Next</a>
								<a href="#">View all</a>
							</div>
						</div>
						<!-- End Pagging -->
						
					</div>
					<!-- Table -->
					
				</div>
				<!-- End Box -->
				
				<!-- Box -->
				<div class="box">
					<!-- Box Head -->
					<div class="box-head">
						<h2>Thêm khách hàng</h2>
					</div>
					<!-- End Box Head -->
					
					<form action="" method="post">
						
						<!-- Form -->
						<div class="form">
								<p>
									<span class="req">max 100 symbols</span>
									<label>Tên khách hàng<span></span></label>
									<input type="text" class="field size1" />
								</p>	
								<p class="inline-field">
									<label>Giới tính</label>
									<select class="field size2">
										<option value="">Nam</option>
										<option value="">Nữ</option>
									</select>
									
								</p>
								
								<p>
									<span class="req">max 100 symbols</span>
									<label>Số điện thoại<span></span></label>
									<input type="text" class="field size1" />
								</p>
								
								<p>
									<span class="req">max 100 symbols</span>
									<label>Địa chỉ<span></span></label>
									<input type="text" class="field size1" />
								</p>

								<p>
									<span class="req">max 100 symbols</span>
									<label>Số CMND<span></span></label>
									<input type="text" class="field size1" />
								</p>	
							
						</div>
						<!-- End Form -->
						
						<!-- Form Buttons -->
						<div class="buttons">
							<input type="button" class="button" value="Reset" />
							<input type="submit" class="button" value="Submit" />
						</div>
						<!-- End Form Buttons -->
					</form>
				</div>
				<!-- End Box -->

			</div>
			<!-- End Content -->
			
			<!-- Sidebar -->
			<div id="sidebar">
				
				<!-- Box -->
				<div class="box">
					
					<!-- Box Head -->
					<div class="box-head">
						<h2>Management</h2>
					</div>
					<!-- End Box Head-->
					
					<div class="box-content">
						<a href="#" class="add-button"><span>Thêm khách hàng</span></a>
						<div class="cl">&nbsp;</div>
						
						<p class="select-all"><input type="checkbox" class="checkbox" /><label>select all</label></p>
						<p><a href="#">Delete Selected</a></p>
						
						<!-- Sort -->
						<div class="sort">
							<label>Sort by</label>
							<select class="field">
								<option value="">Title</option>
							</select>
							<select class="field">
								<option value="">Date</option>
							</select>
							<select class="field">
								<option value="">Author</option>
							</select>
						</div>
						<!-- End Sort -->
						
					</div>
				</div>
				<!-- End Box -->
			</div>
			<!-- End Sidebar -->
			
			<div class="cl">&nbsp;</div>			
		</div>
		<!-- Main -->
	</div>
</div>
<!-- End Container -->

<!-- Footer -->
<div id="footer">
	<div class="shell">
		<span class="left">&copy; 2010 - CompanyName</span>
		<span class="right">
			Design by <a href="http://chocotemplates.com" target="_blank" title="The Sweetest CSS Templates WorldWide">Chocotemplates.com</a>
		</span>
	</div>
</div>
<!-- End Footer -->
	
</body>
</html>
